/*
 * SoundApplication.h
 *
 *  Created on: 2016年4月6日
 *      Author: terry
 */

#ifndef SOUNDSoundApplication_H_
#define SOUNDSoundApplication_H_

#include "BasicType.h"
#include "TSingleton.h"
#include "SharedPtr.h"
#include "TDiscreteArray.h"
#include "CRtpSound.h"


typedef std::shared_ptr< CRtpSound >		CRtpSoundPtr;

typedef comn::DiscreteArray< CRtpSoundPtr, 2048 >		CRtpSoundArray;



class SoundApplication
{
public:
	static SoundApplication& instance();

public:
	SoundApplication();
	virtual ~SoundApplication();

	int init();

	void quit();

	int put(CRtpSoundPtr& session);

	CRtpSoundPtr get(int idx);

	CRtpSoundPtr remove(int idx);

	size_t getCount();

	void removeAll();

private:
	CRtpSoundArray	m_sounds;

};

#endif /* SOUNDSoundApplication_H_ */
